package store.lunangangster.engine.impl.query;

import java.util.List;
import store.lunangangster.engine.impl.cmd.CommandExecutor;
import store.lunangangster.engine.impl.entity.Task;
import store.lunangangster.engine.impl.interceptor.CommandContext;

public class TaskQueryImpl extends AbstractQuery<TaskQuery, Task> implements TaskQuery {

  protected String id;
  protected String key;
  protected String keyLike;
  protected String processInstanceId;
  protected String processDefinitionId;
  protected String user;
  protected String userLike;
  protected String group;
  protected String groupLike;

  public TaskQueryImpl(CommandExecutor executor) {
    super(executor);
  }

  @Override
  protected List<Task> queryList(CommandContext commandContext) {
    return (List<Task>) commandContext.getDbSqlSession().selectList("selectTaskByQuery", this);
  }

  @Override
  protected Page<Task> queryPage(CommandContext commandContext) {
    return null;
  }

  @Override
  protected int queryCount(CommandContext commandContext) {
    return 0;
  }

  @Override
  public TaskQuery id(String id) {
    this.id = id;
    return this;
  }

  @Override
  public TaskQuery key(String key) {
    this.key = key;
    return this;
  }

  @Override
  public TaskQuery keyLike(String keyLike) {
    this.keyLike = keyLike;
    return this;
  }

  @Override
  public TaskQuery processInstanceId(String processInstanceId) {
    this.processInstanceId = processInstanceId;
    return this;
  }

  @Override
  public TaskQuery processDefinitionId(String processDefinitionId) {
    this.processDefinitionId = processDefinitionId;
    return this;
  }

  // @Override
  // public TaskQuery user(String user) {
  //   this.user = user;
  //   return this;
  // }
  //
  // @Override
  // public TaskQuery userLike(String userLike) {
  //   this.userLike = userLike;
  //   return this;
  // }

  // @Override
  // public TaskQuery group(String group) {
  //   this.group = group;
  //   return this;
  // }
  //
  // @Override
  // public TaskQuery groupLike(String groupLike) {
  //   this.groupLike = groupLike;
  //   return this;
  // }
}
